#pragma once  //!防止头文件被重复包含
#include "ti_msp_dl_config.h"
#include "Bsp.h"

//PWM限幅
#define PWM_MAX 3000
#define PWM_MIN -3000

#define AIN1(X)    GPIO_Set(GPIOA,PIN15,X)  
#define AIN2(X)    GPIO_Set(GPIOA,PIN14,X) 
#define BIN1(X)    GPIO_Set(GPIOA,PIN7,X) 
#define BIN2(X)    GPIO_Set(GPIOA,PIN16,X) 


struct ENCODER
{
    volatile long long temp_countl; //保存实时计数值
    volatile long long temp_countr; //保存实时计数值
    int countl;         			//根据定时器时间更新的计数值
    int countr;
};
extern struct ENCODER  Encoder ;


int myabs(int a);
void Motor_Stop(void);
void Set_Pwm(int PWMA,int PWMB);
void Encoder_init(void);
void Timer_init(void);